package com.meeruu.sg.account.core.domain.mapper;

import com.meeruu.sg.account.core.domain.model.AccountFrozenFlowDO;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

/**
 * @author yangqintao
 * @date 2019-05-16
 */
public interface AccountFrozenFlowMapper {

    /**
     * 冻结记录添加
     *
     * @param frozenFlowDO 冻结记录信息
     */
    void insert(@Param("frozenFlow") AccountFrozenFlowDO frozenFlowDO);

    /**
     * 根据flowId查询
     *
     * @param flowId
     */
    AccountFrozenFlowDO selectByFlowId(@Param("flowId") String flowId);


    /**
     * 根据refFlowId查询总解冻金额
     *
     * @param refFlowId 关联的冻结id
     */
    BigDecimal totalAmountByRefFlowId(@Param("refFlowId") String refFlowId);


    /**
     * 冻结记录更新
     *
     * @param frozenFlow
     */
    void update(@Param("frozenFlow") AccountFrozenFlowDO frozenFlow);
}

